home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 26 / Cream of the Crop 26.iso / program / vol16n13.zip / OPENTR.ZIP / OT_SRC.ZIP / OTVIEW.H < prev    next >
C/C++ Source or Header  |  1997-05-26  |  2KB  |  80 lines

  1. // OTView.h : interface of the COpenTrapView class
  2. //
  3. // OpenTrap Version 1.00 by Gregory A. Wolking
  4. // Copyright ⌐ 1997 Ziff-Davis Publishing
  5. // First published in PC Magazine, US Edition, July 1997.
  6. /////////////////////////////////////////////////////////////////////////////
  7.  
  8. class COpenTrapView : public CScrollView
  9. {
  10. protected: // create from serialization only
  11.     COpenTrapView();
  12.     DECLARE_DYNCREATE(COpenTrapView)
  13.  
  14. // Attributes
  15. public:
  16.     // Member functions
  17.     COpenTrapDoc *    GetDocument();
  18.  
  19.     // Member variables
  20.     CFont *                        m_fontCustom;
  21.     UINT                        m_intCurrent_Page;
  22.     UINT                        m_intPage_Count;
  23.     UINT                        m_intFilt_Rec_Count;
  24.  
  25. // Operations
  26. public:
  27.  
  28. // Overrides
  29.     // ClassWizard generated virtual function overrides
  30.     //{{AFX_VIRTUAL(COpenTrapView)
  31.     public:
  32.     virtual void OnDraw(CDC* pDC);  // overridden to draw this view
  33.     virtual BOOL PreCreateWindow(CREATESTRUCT& cs);
  34.     protected:
  35.     virtual void OnInitialUpdate(); // called first time after construct
  36.     virtual BOOL OnPreparePrinting(CPrintInfo* pInfo);
  37.     virtual void OnBeginPrinting(CDC* pDC, CPrintInfo* pInfo);
  38.     virtual void OnEndPrinting(CDC* pDC, CPrintInfo* pInfo);
  39.     virtual void OnUpdate(CView* pSender, LPARAM lHint, CObject* pHint);
  40.     //}}AFX_VIRTUAL
  41.  
  42. // Implementation
  43. public:
  44.     virtual ~COpenTrapView();
  45. #ifdef _DEBUG
  46.     virtual void AssertValid() const;
  47.     virtual void Dump(CDumpContext& dc) const;
  48. #endif
  49.  
  50. protected:
  51.  
  52. // Generated message map functions
  53. protected:
  54.     //{{AFX_MSG(COpenTrapView)
  55.     afx_msg void OnKeyDown(UINT nChar, UINT nRepCnt, UINT nFlags);
  56.     //}}AFX_MSG
  57.     DECLARE_MESSAGE_MAP()
  58. private:
  59.     // Variables
  60.     int        m_intLines_Per_Page;
  61.     CSize    m_sizeCurrent_Page;
  62.     struct filter_list
  63.     {
  64.         packed_record *    pRec;
  65.         UINT            rec_num;
  66.     } *    m_pFiltered_Recs;
  67.  
  68.     // Functions
  69.     void Build_Record_List(void);
  70.     void Calc_Scroll_Sizes(BOOL page_change);
  71.     void Start_New_Page(CDC* pDC, CFont* old_font);
  72. };
  73.  
  74. #ifndef _DEBUG  // debug version in OTView.cpp
  75. inline COpenTrapDoc* COpenTrapView::GetDocument()
  76.    { return (COpenTrapDoc*)m_pDocument; }
  77. #endif
  78.  
  79. /////////////////////////////////////////////////////////////////////////////
  80.